package com.example.provider.javastudy.thread.common;

/**
 * 继承方法实现多线程
 *
 * @Package com.example.demo.thread
 * @author: 红雪（hongxue@maihaoche.com）
 * @date: 2019/1/16 9:26 AM
 * @Copyright: 2017-2020 www.maihaoche.com Inc. All rights reserved.
 * 注意：本内容仅限于卖好车内部传阅，禁止外泄以及用于其他的商业项目
 */
public class KillThread extends Thread {

private Hero hero;
private Hero attackedHero;
public KillThread(Hero hero,Hero attackedHero){
    this.hero = hero;
    this.attackedHero = attackedHero;
}
    @Override
    public void run(){
        while (!attackedHero.isDead()){
            hero.attackHero(attackedHero);
        }
    }
}
